﻿#ifndef			_LIBINI_ITEM_H_
#define			_LIBINI_ITEM_H_


#include <libini/header.h>
#include <libini/explain.h>


namespace Xanadu::ini
{
	class LIBINI_EXPORT item
	{
	private:
		// Comments for row data
		std::list<Xanadu::ini::explain>		_memberComment;

		// Key for row data
		std::string 				_memberKey;

		// Value for row data
		std::string 				_memberValue;

	public:
		// constructor
		explicit item() noexcept;

		// constructor
		explicit item(const std::string& _String) noexcept;

		// constructor
		item(const Xanadu::ini::item& _Other) noexcept;

		// destructor
		virtual ~item() noexcept;

	public:
		// operator overload =
		Xanadu::ini::item& operator = (const Xanadu::ini::item& _Other) noexcept;

	public:
		// Set the data for the row
		virtual void setData(const std::string& _String) noexcept final;

	public:
		// Is it empty
		virtual bool empty() const noexcept;

		// Does it exist
		virtual bool exist() const noexcept;

		// Get comment
		virtual std::string comment() const noexcept;

		// Get key
		virtual std::string key() const noexcept;

		// Get value
		virtual std::string value() const noexcept;

	public:
		// Set comment
		virtual void setComment(const std::string& _Comment) noexcept;

		// Set comment
		virtual void setComment(const std::list<std::string>& _Comments) noexcept;

		// Set key
		virtual void setKey(const std::string& _Key) noexcept;

		// Set value
		virtual void setValue(const std::string& _Value) noexcept;

	public:
		// Convert to string
		virtual std::string toString() const noexcept;

		// Format from one or more lines of strings
		static Xanadu::ini::item fromStrings(const std::list<std::string>& _Strings) noexcept;
	};
}

#endif
